<template>
	<view class="warp">
		<!-- #ifdef APP-PLUS -->
		<view class="title-contents"><view class="top-view status"></view></view>
		<!-- #endif -->
		<!-- 密码登录 -->
		<view class="login-phone form-wapper">
			<view class="phone input-wapper">
				<view class="lside"><text class="iconfont icon-shouji"></text></view>
				<view class="mobile rside"><input v-model="username" placeholder-class="input-placeholder"  type="number" placeholder="请输入手机号" /></view>
			</view>
			<view class="phone input-wapper">
				<view class="lside"><text class="iconfont icon-yanzhengma"></text></view>
				<view class="mobile rside"><input v-model="vercode" placeholder-class="input-placeholder" type="number"  placeholder="请输入验证码" /></view>

				<view>
					<button type="default" @click="acquire">获取验证码</button>
				</view>
			</view>
			<view class="code input-wapper">
				<view class="lside"><text class="iconfont icon-mima2"></text></view>
				<view class="rside"><input v-model="password" placeholder-class="input-placeholder" type="password" maxlength="12"  placeholder="请设置新密码(6-12位) " /></view>
			</view>
		</view>

		<button type="primary" class="login-btn" @click="confirm" >确定</button>
	</view>
</template>
<script>
	export default{
		data(){
			return{
				username:'18568602726',
				password:'123456',
				vercode:''
			}
		},
		methods: {
			acquire(){
				uni.request({
					url: 'https://4de16698-d9f4-443a-b416-ef1037cce952.bspapp.com/http/user/sendSms', //仅为示例，并非真实接口地址。
					data: {
						mobile: this.username,
						type: "register"
					},
					success: (res) => {
						console.log(res.data);
						this.text = 'request success';
					}
				});
			},
			confirm(){
				uni.request({
					url: 'https://4de16698-d9f4-443a-b416-ef1037cce952.bspapp.com/http/user/reg', //仅为示例，并非真实接口地址。
					data: {
						username: this.username,
						password: this.password,
						vercode: this.vercode
					},
					success: (res) => {
						console.log(res.data);
						this.text = 'request success';
					}
				});
			}
		}
	}
</script>
<style lang="scss">
@import  "login.scss"
</style>
